import java.io.File;
import java.io.IOException;

public class day_04_File_3 {
    public static void main(String[] args) throws IOException {
        // public boolean createNewFile() 创建一个新的空的文件
        File file = new File("1.java");
        Boolean newResult = file.createNewFile();
        System.out.println(newResult ? "文件创建成功！" : "文件创建失败");

        // public boolean mkdir() 创建单级文件夹
        File file2 = new File("java");
        Boolean newDirResult = file2.mkdir();
        System.out.println(newDirResult ? "目录创建成功！" : "目录创建失败");

        // public boolean mkdirs() 创建多级文件夹
        File file3 = new File("python//java//c");
        Boolean newDirsResult = file3.mkdirs();
        System.out.println(newDirsResult ? "多级目录创建成功！" : "多级目录创建失败");

        // public boolean delete() 删除文件、空文件夹
        Boolean deleteResult1 = file.delete();
        System.out.println(deleteResult1 ? "删除成功！" : "删除失败");

        Boolean deleteResult2 = file2.delete();
        System.out.println(deleteResult2 ? "删除成功！" : "删除失败");
        
        Boolean deleteResult3 = file3.delete();
        System.out.println(deleteResult3 ? "删除成功！" : "删除失败");
    }
}
